package com.yeung.exam;

import java.util.Scanner;

public class 小Q开宝箱1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int bs = sc.nextInt();
        int ks = sc.nextInt();
        if (ks == 0 || bs == 0) {
            System.out.println(0);
            return;
        }
        int bInd = 0;
        int[] boxs = new int[bs];
        int keys[] = new int[ks];
        int kInd = 0;
        while (bInd < bs) {
            boxs[bInd++] = sc.nextInt();
        }
        while (kInd < ks) {
            keys[kInd++] = sc.nextInt();
        }
        //开始计算
        //1 求箱子中得奇数和偶数
        int box_j = 0;
        int box_o = 0;
        for (int box : boxs) {
            if (box % 2 == 0)
                box_o++;
            else box_j++;
        }
        //2求钥匙得偶数和奇数
        int key_o = 0;
        int key_j = 0;
        for (int key : keys) {
            if (key % 2 == 0) key_o++;
            else key_j++;
        }

        int result = 0;
        result += (box_o * key_j);
        result += (box_j * key_o);
        System.out.println(result);
    }
}
